package com.sdu.cloudservice.entity;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

/**
 * Create by zekdot on 19-7-1.
 */
public class PredictPriceEntityPK implements Serializable {
    private String zoneId;
    private String instanceId;
    private String time;

    @Column(name = "zone_id")
    @Id
    public String getZoneId() {
        return zoneId;
    }

    public void setZoneId(String zoneId) {
        this.zoneId = zoneId;
    }

    @Column(name = "instance_id")
    @Id
    public String getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(String instanceId) {
        this.instanceId = instanceId;
    }

    @Column(name = "time")
    @Id
    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PredictPriceEntityPK that = (PredictPriceEntityPK) o;
        return Objects.equals(zoneId, that.zoneId) &&
                Objects.equals(instanceId, that.instanceId) &&
                Objects.equals(time, that.time);
    }

    @Override
    public int hashCode() {
        return Objects.hash(zoneId, instanceId, time);
    }
}
